﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using TF.Access;
using SystemFramework.Util;

public partial class TFUserProfile : System.Web.UI.Page
{
    protected string nickName;
    protected string pic;
    protected string gender;
    protected string homeProvinceCity;
    protected string city;
    protected string uid;
    
    protected void Page_Load(object sender, EventArgs e)
    {
        TF_UserProfile up = TF_UserProfile.Select(ConvertHelper.GetInt(Request["uid"],0));
        if (up != null)
        {
            uid = up.Uid.ToString();
            nickName = up.Nick_Name;
            pic = up.Pic;
            gender = up.Gender == "M" ? "男" : "女";
            string homeProvince = string.Empty;

            TF_Province homeProvinceInstance = TF_Province.Select(up.HomeProvinceId);
            homeProvince = homeProvinceInstance != null ? homeProvinceInstance.Provice_Name : string.Empty;
            string homeCity = string.Empty;
            TF_City homeCityInstance = TF_City.Select(up.HomeCityId);
            homeCity = homeCityInstance != null ? homeCityInstance.CityName : string.Empty;
            homeProvinceCity = string.Format("{0} {1}", homeProvince, homeCity);

            TF_City cityObj = TF_City.Select(up.CityID);
            if (cityObj != null)
            {
                city = TF_City.Select(up.CityID).CityName;
            }
        }
    }
}
